<template>
    <table>
        <tr>
            <td>手机号</td>
            <td><input type="text" v-model="Utel"></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input type="password" v-model="Upwd"></td>
        </tr>
        <tr>
            <td colspan="2">
                <button @click="Login">登录</button>
            </td>
        </tr>
    </table>
    </template>
<script setup lang="ts">
import axios from 'axios';
import {ref} from 'vue'
const Utel=ref()
const Upwd=ref()
const Login=()=>{
    axios.get('https://localhost:44369/api/Lx/Login',
        { 
            params:
            {
                Utel:Utel.value,
                Upwd:Upwd.value
            }
        }
    ).then(res=>{
        if(res.data==-1){
            alert("账号/密码错误，请重新输入")
            return
        }
        else{
            alert("登录成功！")
        }
    }).catch(err=>{
        console.log(err)
    })
}
</script>

